package com.core.controller;

import com.core.service.StockService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author SunChangSheng
 * @apiNote
 * @since 2021/8/18 18:49
 */
@RestController
@RequestMapping("stock")
public class StockController {
    private final StockService stockService;

    public StockController(StockService stockService) {
        this.stockService = stockService;
    }

    /**
     * 扣除库存
     * @return
     */
    @RequestMapping("reduce")
    public int reduceStock() {
        System.out.println("扣除库存");
        return stockService.reduceStock();
    }
}
